<ion-view view-title=我的任务 >
  <ion-content>
    <ion-refresher on-refresh="doRefresh()"
                   pulling-text="下拉刷新..."
                   refreshing-text="拼命加载中..."
                   refreshing-icon="ion-loading-b">

    </ion-refresher>
      <div class="list card" ng-repeat="mymission in mymissions" href="#">
        <div class="item">
          <h2>{{mymission.area.areaName}}区-<span ng-if="(mymission.orderInfo.get('type') != 9)" style="color: red;">{{mymission.orderInfo.get('type') | orderTypeName}}</span><span ng-if="(mymission.orderInfo.get('type') === 9)">商家外卖</span>{{mymission.orderid}} <a class="float-right" style=" color: orange" ng-click="goToFirst(mymission.orderid)">优先</a></h2>
        </div>
        <div class="item item-body">
          <p>
            派送地址：{{mymission.address.address}}
          </p>
          <!--<p>-->
            <!--收件人：{{mymission.address.name}} <a>{{mymission.address.phone}}</a>-->
          <!--</p>-->
          <p ng-if="(mymission.orderInfo.get('type') != 9)">
            取件地址：{{mymission.shop.areaName}}
          </p>
          <p ng-if="(mymission.orderInfo.get('type') === 9)">
            取件地址：{{mymission.orderInfo.get('sellerName')}}--{{mymission.orderInfo.get('storeName')}}
          </p>
          <!--<p>-->
          <!--支付方式：{{mymission.orderInfo.payway}}-->
          <!--</p>-->
          <p>
          下单时间：{{mymission.orderInfo.createdAt | date : 'yyyy-MM-dd HH:mm:ss'}}
          </p>
          <p >
          订单状态：{{mymission.orderInfo.get('status') |  orderState }}
          </p>
          <p ng-if="mymission.bookdate !=undefined">
            预约时间：{{mymission.bookdate | date : 'yyyy-MM-dd HH:mm:ss'}}
          </p>
        </div>
        <div class="item button-bar" >
          <a class="button" style="color:white;background-color: red" ng-show="mymission.orderStatus<0" ng-click="cancelMission(mymission.orderid)">取消</a>
          <a class="button" ng-click="gotoDetail(mymission.orderid)">任务详情</a>
        </div>
      </div>
    <div ng-if="(mymissions.length == 0)" class="card">
      <div class="item item-text-wrap">
        啥都没有~去领任务吧。
      </div>
    </div>
    <div style="text-align: center" ng-if="(mymissions.length != 0)">
      <a style="color: green;text-align: center" ng-click="getMore()" >{{loadmore.more}}</a>
    </div>
  </ion-content>
</ion-view>
